# coding: UTF-8
# Filename : cmd.py
# Company : imedia
# Author : rose
# -*-coding:utf-8 -*-
import sys,datetime
import os,commands
#日期设定
today = str(datetime.date.today())
if len(sys.argv) >= 2:
    today = sys.argv[1]




pv_shell = 'grep "" /opt/log/access_log.%s -c' % today
(a,b) = commands.getstatusoutput(pv_shell)
print 'pv:' + str(b)




uv_shell = '''grep "" /opt/log/access_log.%s | awk -F '`' '{print $2 | "sort -u"}' | wc -l''' % today
(a,b) = commands.getstatusoutput(uv_shell)
print 'uv:' + str(b)